前言
主题文件夹下的 _config.yml 里的参数可以进行修改,从而配置主题。
正文
基本参数
| 名称 |
描述 |
| title |
网站主页标题 |
| suffix |
网站标题后缀 |
| author |
作者名称(会显示在首页文章下面) |
| keyword |
网站关键字 |
| web_description |
网站描述 |
| lang |
网站语言 |
| since_year |
网站建站时间 |
| logo |
网站 LOGO(左上角的图标) |
about
about 属性可以设置个人信息,这将显示在侧边栏中:
about: author: Zi-Zi portrait: 'https://gz-metal-cell.github.io/about/portrait.png' description: '不以物喜,不以己悲。'
|
headers 属性可以设置页面顶部的信息和图标:
headers: home: { message: "居然被你找到了这里!", icon: "/images/headers_icon/logo_white.webp", } categories: { message: "好像也没分几类", icon: "/images/headers_icon/categories.svg", } tags: { message: "这里是一些展示的标签", icon: "/images/headers_icon/tags.svg", } archives: { message: "居然一共才写了 number 篇文章!", message_month: "在 year 年 month 月里写了 number 篇文章!", message_year: "在 year 年里写了 number 篇文章!", icon: "/images/headers_icon/archives.svg", } galleries: { message: "有趣的相册~(施工中)", icon: "/images/headers_icon/galleries.svg", } links: { message: "一些神奇小网站~", icon: "/images/headers_icon/links.svg", } about: { message: "关于我", icon: "/images/headers_icon/about.svg", }
|
网站访问统计
web_analytics 可以对网站访问进行统计,支持不蒜子访问统计(在网页上显示访问量)和百度统计(后台查看访问信息)。
web_analytics: enable: true busuanzi: true baidu:
|
评论系统
Quieter 支持 giscus 和 gitalk 两种评论系统,需要自行在 github 上配置。
giscus: enable: false repo: repo_id: category: Announcements category_id: mapping: title strict: 1 reactions-enabled: 1 emit_metadata: 0 input_position: bottom
gitalk: enable: false clientID: clientSecret: repo: owner: admin:
|
bottom_icon
bottom_icon 属性控制侧边栏的个人介绍页面底部的信息:
bottom_icon: - { name: "weibo", icon: "/images/bottom_icon/Weibo.webp", link: "", } - { name: "tieba", icon: "/images/bottom_icon/Tieba.webp", link: "", } - { name: "bilibili", icon: "/images/bottom_icon/Bilibili.webp", link: "", } - { name: "github", icon: "/images/bottom_icon/github.webp", link: "", }
|
特殊页面配置
下述的参数可以配置特殊页面的显示内容:
archive_aside: true
tag_aside: true
archive_toc: true
tag_toc: true
|
pagination 用于设置首页翻页按钮显示的上下文页数:
search
Quieter 对 hexo-generator-search 进行了适配支持,如果本地搜索功能被正确地安装,将 search 值改为 true 即可在归档页处搜索文章:
lazyload
Quieter 对 hexo-lazyload-image 进行了适配支持,如果图片懒加载功能被正确地安装,将 lazyload 值改为 true 即可开启该功能的适配:
wordcount
Quieter 提供前端的字数统计功能,以如下方法打开:
空格替换
适配 hexo-renderer-kramed 插件。
默认情况下,在本地的 Markdown 打出的制表符/多个空格会被渲染成一个空格。将 replaceSpacesWithNbsp 设为 true 可将它们正确渲染:
replaceSpacesWithNbsp: true
|
fancybox
设置 fancybox。
主题中内嵌了 fancybox。
fancybox: enable: true css: css/plugins/fancybox.css js: js/plugins/fancybox.umd.js
|
数学公式
mathjax 和 katex 用于显示数学公式,二者取其一。
主题中内嵌了 katex。
mathjax: enable: false js: https://cdn.jsdelivr.net/npm/mathjax@4.0.0-beta.3/tex-mml-chtml.js
katex: enable: true css: /js/plugins/katex/katex.min.css js: /js/plugins/katex/katex.min.js auto_render: /js/plugins/katex/auto-render.min.js copy_tex: enable: true css: /css/plugins/copy-tex.css js: /js/plugins/copy-tex.js
|
mermaid
Mermaid 允许用户用简便的代码绘制图表:
mermaid: enable: true js: https://cdn.jsdelivr.net/npm/mermaid@11.4.0/dist/mermaid.min.js options:
|
default_cover
如果某个文章没有设置 cover,则会使用 default_cover 里的值作为封面:
default_cover: "/images/random_covers/01.webp"
|
random_top_img
如果某个文章没有设置 top_img,则会从 random_top_img 下面的列表中随机选取一张:
random_top_img: - "/images/random_top_img/01.webp" - "/images/random_top_img/02.webp" - "/images/random_top_img/03.webp" - "/images/random_top_img/04.webp" - "/images/random_top_img/05.webp" - "/images/random_top_img/06.webp" - "/images/random_top_img/07.webp"
|
inject
如果需要在网页中加入某些 html 语句而不修改主题内部代码,下述是一个简单的方式。
icp
如果网站需要填写 ICP 备案信息,可在这里填写:
icp: enable: false icon: link: text:
|